import Vue from "vue";
import App from "./App";
import router from "./router";
//引入http请求方法
import { axiosFun } from "./public/js/axiosFun.js";
import { requiredFun } from "./public/js/requiredFun.js";
import "element-ui/lib/theme-chalk/index.css";
import {
  Tree,
  Popover,
  Message,
  MessageBox,
  Switch,
  Slider,
  Dialog,
  Menu,
  MenuItem,
  Button,
  Input,
  Form,
  FormItem,
  Upload,
  Select,
  Option,
  Pagination,
  Radio,
  Checkbox,
  elFormItem,
  Submenu,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  Table,
  TableColumn,
  DatePicker,
  TimePicker,
  TimeSelect,
  Card,
  Col,
  Row,
  Loading,
  Cascader,
  Carousel,
  CarouselItem,
  Breadcrumb,
  BreadcrumbItem
} from "element-ui";
Vue.use(Tree);
Vue.use(Popover);
Vue.use(Cascader);
Vue.use(Button);
Vue.use(Radio);
Vue.use(Switch);
Vue.use(Slider);
Vue.use(Dialog);
Vue.use(Menu);
Vue.use(MenuItem);
Vue.use(Input);
Vue.use(Upload);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Select);
Vue.use(Option);
Vue.use(Pagination);
Vue.use(Checkbox);
Vue.use(Submenu);
Vue.use(Dropdown);
Vue.use(DropdownMenu);
Vue.use(DropdownItem);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(DatePicker);
Vue.use(TimePicker);
Vue.use(TimeSelect);
Vue.use(Card);
Vue.use(Col);
Vue.use(Row);
Vue.use(Loading);
Vue.use(Carousel);
Vue.use(CarouselItem);
Vue.use(Breadcrumb);
Vue.use(BreadcrumbItem);
Vue.prototype.$confirm = MessageBox.confirm;
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$prompt = MessageBox.prompt;
Vue.prototype.$message = Message;
Vue.prototype.$http = axiosFun;
Vue.prototype.$requiredFun = requiredFun;

router.beforeEach(function(to, from, next) {
  next();
});

router.afterEach(function(to) {});

global.PageSizeArray = [10, 20, 50];

new Vue({
  router,
  render: h => h(App)
}).$mount("#app");
